<?php
/*
 * PHPVersionUnder
 *
 * Tests that the running PHP Version is >= the supplied parameter
 */
 
class PHPVersionUnder extends BaseTest{

	function PHPVersionUnder($params){
		parent::BaseTest($params);	

		if(!is_array($this->params) || count($this->params) <= 0){
			ErrorStack::addError("Invalid parameters, version to test against must be supplied as the only item in an array", ERRORSTACK_ERROR, 'PHPVersionUnder');
			$this->result = INSTALLER_TEST_FAIL;
			return $this->result;
		}
	}
	
	function perform(){		
		if(version_compare(phpversion(), $this->params[0], '<')){
			$this->result_message = "La Versionde PHP No Debe Ser Superior a {$this->params[0]}, Tu Estas Usando ".phpversion();
			$this->result = INSTALLER_TEST_SUCCESS;
			return $this->result;
		}else{
			$this->result = INSTALLER_TEST_FAIL;
			$this->result_message = "La Versionde PHP No Debe Ser Superior a {$this->params[0]}, Tu Estas Usando ".phpversion();
		}
		
		return $this->result;
	}
}
?>
